package com.sofwin.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sofwin.controller.Cinformation;
import com.sofwin.mapper.CInformationMapper;
import com.sofwin.pojo.CInformation;
import com.sofwin.pojo.CInformationExample;
import com.sofwin.pojo.CInformationWithBLOBs;
import com.sofwin.service.CompanyListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;

/**
 * @program: authority-management-system.git
 * @description: TODO
 * @author: Mr.Gao
 * @create: 2021-04-24 09:36
 **/
@Service
public class CompanyListServiceImpl implements CompanyListService {

    @Autowired
    private CInformationMapper cInformationMapper;

    @Override
    public PageInfo<CInformation> selectCompanyListByPage(CInformation cInformation, Integer pageNumber, Integer pageSize) {
        PageHelper.startPage(pageNumber,pageSize);
/*        CInformationExample ex = new CInformationExample();
        CInformationExample.Criteria criteria = ex.createCriteria();
        if (cInformation.getId()!=null && cInformation.getId()!=0){
            criteria.andCompanyIdEqualTo(cInformation.getId());
        }
        List<CInformationWithBLOBs> cInformationWithBLOBs = cInformationMapper.selectByExampleWithBLOBs(ex);*/
        CInformationExample ex = new CInformationExample();
        CInformationExample.Criteria criteria = ex.createCriteria();
        criteria.andCompanyIdEqualTo(cInformation.getCompanyId());
        List<CInformation> cInformations1 = cInformationMapper.selectByExample(ex);
        return new PageInfo<CInformation>(cInformations1);
    }


}
